<?php

class Webkul_Marketplacepartner_PartnersController extends Mage_Adminhtml_Controller_Action
{
	public function indexAction(){
        if($this->getRequest()->getQuery('ajax')){
            $this->_forward('grid');
            return;
        }
        $this->loadLayout();
        //Set active menu item
        $this->_setActiveMenu('marketplacepartner');
		//Append freebidspromo block to content
        $this->_addContent($this->getLayout()->createBlock('marketplacepartner/partners', 'partners'));
		$this->renderLayout();
	}
		
    public function gridAction(){
        $this->getResponse()->setBody($this->getLayout()->createBlock('marketplacepartner/partners_grid')->toHtml());
    }
	
	public function ltp(){
        $data = array();
		$data['name'] = 'SI!';
		$data['description'] = 'ASDAasdsad asd ad .arcu quam commodo nisl, vel tincidunt massa orci eget nisi. Quisque vehicula enim. Praesent sodales lectus eget lectus. Duis vel l';
		$data['short_description'] = 'Qasdasdmsa oinadfi dns. Nam nisl tellus, dapibus in; elementum ac, sollicitudin sed';
		$data['price'] = 20;
		$data['stock'] = 45;
		$data['weight'] = 0.5;
		$data['customer_id'] = 1;
        Mage::getModel('marketplacepartner/marketplacepartner')->createPartnerProduct($data);
	}
	//action of  is partner
	public function massispartnerAction(){
		Mage::getModel('marketplaceprofile/marketplaceprofile')->massispartner($this->getRequest());
		$this->_getSession()->addSuccess(Mage::helper('marketplacepartner')->__('Your User was successfully saved'));
		$this->_redirect('marketplacepartner/partners/');
	}
	//action of  is not partner
	public function massnotpartnerAction(){	
		Mage::getModel('marketplaceprofile/marketplaceprofile')->massisnotpartner($this->getRequest());
		$this->_getSession()->addSuccess(Mage::helper('marketplacepartner')->__('Your User was successfully saved'));
		$this->_redirect('marketplacepartner/partners/');
	}
}
